let express = require('express')
let bodyParser = require('body-parser')
let app = express()
let {login} = require('./router/login')
let {register} = require('./router/register')
let {movie} = require('./router/movie')
let {news} = require('./router/news')
let {dynamic} = require('./router/dynamic')
let {user} = require('./router/user')
let {comment} = require('./router/comment')
let {favorites} = require('./router/favorites')
// const bodyParser = require('body-parser');
app.use(bodyParser.urlencoded({extended:true}))
app.all('*',(req,res,next)=>{
    res.set({
        'Access-Control-Allow-Origin':'*',
        'Content-Type': 'text/plain'
    })
    next()
})
app.use(login)
app.use(register)
app.use(movie)
app.use(news)
app.use(dynamic)
app.use(user)
app.use(comment)
app.use(favorites)
app.listen(8888,()=>{
    console.log('服务启动成功....')
})